<template>
    <div>
        <!-- uid不存在显示此页 -->
        <router-view></router-view>

        <!-- uid存在显示此页 -->
        <InMine v-show="showInMine" />
    </div>
</template>

<script>
    import InMine from '../Home/Mine/InMine'
    export default {
    data() {
        return {
            showInMine:true,  // 控制组件显示
        };
    },

    components: {
        InMine
    },

    mounted() {
        this.ifuid()
    },

    methods: {
       ifuid() { // 判断uid是后存在
            if (localStorage.getItem('uid')) { // 存在，进入个人中心
                this.showInMine = true;
                this.$store.commit('changeShowMine',true)
            } else { // 不存在，进入登陆页
                this.$router.replace('mine/NotLogin');
                this.showInMine = false;
                // localStorage.setItem('uid','121')
            }
        }
    }
};
</script>
<style lang='stylus' scoped>
   

</style>
